package com.gupao.rpc.consumer.controller;

import com.gupao.rpc.api.ITestService;
import com.gupao.rpc.api.IUserService;
import com.gupao.rpc.protocol.annotation.RpcRemoteReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/")
public class UserController {

    @RpcRemoteReference
    private IUserService userService;

    @RequestMapping(value = "/user/say")
    public String sayHello() {
        return userService.sayHello("mic");
    }

    @RpcRemoteReference
    private ITestService testService;

    @RequestMapping(value = "/test")
    public String say() {
        return testService.say();
    }

}
